<template>
  <el-dialog v-model="dialogVisible" title="筛选条件" width="900">
    <el-form>
      <el-form-item label="存货名称">
        <el-input v-model="state.form.invname" placeholder="请录入存货名称" />
      </el-form-item>
      <el-form-item label="工序编码">
        <el-input v-model="state.form.opCode" placeholder="请录入工序编码" />
      </el-form-item>
      <el-form-item label="工序名称">
        <el-input v-model="state.form.opName" placeholder="请录入工序名称" />
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="toConfirm()">确认</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
  const dialogVisible = ref(false)
  const state = reactive({
    form: {
      invname: '',
      opCode: '',
      opName: '',
    },
  })
  const close = () => {
    dialogVisible.value = false
  }
  const handleOpen = (params) => {
    state.form = {
      ...(state.form || {}),
      ...(params || {}),
    }
    dialogVisible.value = true
  }
  const toConfirm = () => {
    _emits('searchParamCallback', state.form)
    dialogVisible.value = false
  }
  const _emits = defineEmits(['searchParamCallback'])
  defineExpose({ handleOpen })
</script>
<style lang="scss" scoped></style>
